import Vue from 'vue'
import App from './App.vue'
//三级联动-----全局组件
import TypeNav from '@/components/TypeNav';
import Carousel from '@/components/Carousel';
import Pagination from '@/components/Pagination';
//引入element-ui
import { Button, MessageBox } from 'element-ui';
Vue.component(Button.name, Button);

//第二种注册全局组件的方法
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$msgbox = MessageBox;
//第一个参数：全局组件的名字，第二个参数：哪一个组件
//引入路由
import router from '@/router'
//引入仓库
import store from '@/store';
Vue.component(TypeNav.name,TypeNav)
Vue.component(Carousel.name,Carousel)
Vue.component(Pagination.name,Pagination)

//引入MockServer.js -----mock数据
import "@/mock/mockServe.js";
//引入swiper样式 写录播图
import "swiper/css/swiper.css";
// import {reqGetSearchInfo} from '@/api';
import * as API from '@/api';
import VueLazyload from 'vue-lazyload';
import chaiquan from '@/assets/images/1.gif';
import myPlugins from '@/plugins/myPlugins';
import "@/validate/validate";
Vue.use(myPlugins,{
  name:'upper'
});


//注册插件
Vue.use(VueLazyload,{
  //懒加载
  loading: chaiquan
})
new Vue({
  render: (h) => h(App),
  //全局事件总线$bus配置
  beforeCreate(){
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  router,
  //注册仓库：组件实例的身上会多一个属性$store属性
  store
}).$mount('#app')
